package cn.formaggie.service.impl;

import cn.formaggie.dao.OrderDao;
import cn.formaggie.entity.model.order.Order;
import cn.formaggie.service.face.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service("orderService")
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderDao orderDao;

    @Override
    public List<Order> getAllOrders() {
        return orderDao.getAllOrders();
    }

    @Override
    public List<Order> findOrders(Map<String, Object> map) {
        return orderDao.findOrders(map);
    }

    @Override
    public Integer getOrdersCount(Map<String, Object> map) {
        return orderDao.getOrdersCount(map);
    }

    @Override
    public Boolean addOrder(Order order) {
        return orderDao.addOrder(order)>0?true:false;
    }

    @Override
    public Boolean modifyOrderInfo(Order order) {
        return orderDao.modifyOrderInfo(order)>0?true:false;
    }

    @Override
    public Boolean modifyState(Order order) {
        return orderDao.modifyState(order)>0?true:false;
    }

    @Override
    public Boolean deleteOrder(Integer id) {
        return orderDao.deleteOrder(id)>0?true:false;
    }
}
